<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>

        p {
            text-align: center;
        }

        h1 {
            text-align: center;
        }

       /* body {
            text-align: center;
        }*/

        span {
            /*span是行内元素，p和h1是块级元素*/
            text-align: center; /*不能用在行内元素上，要用在行内元素的父元素上*/
        }
    </style>
</head>
<body>
<h1>hello</h1>
<p>hello</p>
<span>hello</span>
</body>
</html>
